from base import Base
from selenium.webdriver.common.by import By
from time import sleep


class Page(Base):
    sousuokuang = (By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/androidx.drawerlayout.widget.DrawerLayout/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.RelativeLayout/android.widget.RelativeLayout[2]/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.TextSwitcher/android.widget.TextView')
    sousuoanniu = (By.XPATH,'//android.widget.TextView[@text="搜索"]')
    quanbu = (By.ID,'com.xiachufang:id/tv_content')
    yuqi = (By.ID,'//android.widget.LinearLayout[@resource-id="com.xiachufang:id/ll_labels_container"]')
    dy = (By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.HorizontalScrollView/android.widget.LinearLayout/androidx.appcompat.app.ActionBar.Tab[1]/android.widget.TextView')

    def sousuoyewu(self):
        self.find_ele(self.sousuokuang).click()
        sleep(2)
        self.find_ele(self.sousuoanniu).click()

    shushukuang = (By.ID,'com.xiachufang:id/search_edit_text')
    dy2 = (By.XPATH,'//android.widget.TextView[@text="全部"]')
    dy3 = (By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.HorizontalScrollView/android.widget.LinearLayout/androidx.appcompat.app.ActionBar.Tab[2]/android.widget.TextView')

    def sousuoddtpage(self,neirong):
        self.find_ele(self.sousuokuang).click()
        sleep(2)
        self.find_ele(self.shushukuang).send_keys(neirong)
        sleep(2)
        self.find_ele(self.sousuoanniu).click()
        sleep(2)